<?php
/**
 * MultiExceptionReporter class definition
 *   
 * @author Sean Crystal <seancrystal@gmail.com>
 * @package MutantVole
 */
require_once 'interfaces/iExceptionReporter.php';
require_once 'components/exceptions/ScreenExceptionReporter.php';
require_once 'components/exceptions/LogExceptionReporter.php';

/**
 * Allows exceptions to be reported by more than one reporter at a time
 * @package MutantVole
 * @subpackage Exceptions
 */   
class MultiExceptionReporter implements iExceptionReporter {
	/**
     * Iterates through all attached reporters and reports the exception
     * @param Exception $e
     */ 
	public function ReportException(Exception $e) {
		if (is_array($this->reporters)) {
 			foreach ($this->reporters as $reporter) {
				$reporter->ReportException($e);
			}
		}
	}
	
	/**
     * Attach an exception reporter
	 * @param iExceptionReporter $reporter
	 */  	
	public function AttachReporter(iExceptionReporter $reporter) {
		$this->reporters[] = $reporter;		
	}
	
	/**
     * Contains the exception reporters that will all report an exception
	 * @var array
	 */  	
	protected $reporters = array();
}





?>